# title = "alice in wonderland"
# print(title.split())

filename = 'alice.txt'
try:
    with open(filename) as f_obj:
        contents = f_obj.read()
except FileNotFoundError:
    msg = "sorry,the file"+filename+"does not exist"
    print(msg)
else:
    # 计算文件大致包含多少单词
    words = contents.split()
    num_words = len(words)
    print("the file"+filename+"has about"+str(num_words)+"words")